<template>
  <div class="layout">
    <el-container class="container">
      <el-aside class="aside" v-if="showBack">
        <Aside/>
      </el-aside>

      <el-main class="content">
        <el-container>
          <Header v-if="showBack"> </Header>
          <FrontHeader v-if="!showBack"></FrontHeader>
          <div class="main">
            <router-view />
          </div>
          <el-footer>
            <Footer ></Footer>
          </el-footer>
        </el-container>
      </el-main>
    </el-container>
  </div>



</template>

<script >
  import Header from "./components/Header.vue";
  import Footer from "./components/Footer.vue";
  import Aside from "./components/Aside.vue";
  import FrontHeader from "./components/FrontHeader.vue";
  import router from "./router";
  import http from "./utils/req";
  import userService from "./utils/userService";
  export default {
    components: {FrontHeader, Aside, Footer, Header},
    data(){
      return{

      }
    },
    computed: {
        showBack(){
          return router.currentRoute.value.fullPath !== '/';
      }
    },
    mounted(){

    }
  }

</script>

<style scoped>
  .layout {
    min-height: 100vh;
    background-color: #ffffff;
  }
  .container {
    height: 100vh;
  }
  .aside {
    width: 200px!important;
    background-color: #222832;
    overflow: hidden;
    overflow-y: auto;
    -ms-overflow-style: none;
    overflow: -moz-scrollbars-none;
  }
  .aside::-webkit-scrollbar {
    display: none;
  }

  .head > div {
    display: flex;
    align-items: center;
  }

  .head img {
    width: 50px;
    height: 50px;
    margin-right: 10px;
  }
  .head span {
    font-size: 20px;
    color: #ffffff;
  }

  .content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 5px 0 0;
  }
  .main {
    height: calc(100vh - 100px);
    overflow: auto;
    padding: 3px;
  }
</style>

<style>
  body {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }
  a {
    color: #409eff;
    text-decoration: none;
  }
  .el-pagination {
    text-align: center;
    margin-top: 20px;
  }
  .el-popper__arrow {
    display: none;
  }
</style>